licenses(["notice"])

package(default_visibility = ["//visibility:public"])

java_library(
    name = "gcp_kms_client",
    srcs = ["GcpKmsClient.java"],
    plugins = [":auto_service_plugin"],
    deps = [
        ":gcp_kms_aead",
        "//src/main/java/com/google/crypto/tink:aead",
        "//src/main/java/com/google/crypto/tink:kms_client",
        "//src/main/java/com/google/crypto/tink:kms_clients",
        "//src/main/java/com/google/crypto/tink:version",
        "//src/main/java/com/google/crypto/tink/subtle:validators",
        "@maven//:com_google_api_client_google_api_client",
        "@maven//:com_google_apis_google_api_services_cloudkms",
        "@maven//:com_google_auth_google_auth_library_oauth2_http",
        "@maven//:com_google_auto_service_auto_service_annotations",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
        "@maven//:com_google_http_client_google_http_client",
        "@maven//:com_google_http_client_google_http_client_gson",
        "@maven//:com_google_oauth_client_google_oauth_client",
    ],
)

java_library(
    name = "gcp_kms_aead",
    srcs = ["GcpKmsAead.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink:aead",
        "@maven//:com_google_api_grpc_proto_google_cloud_kms_v1",
        "@maven//:com_google_apis_google_api_services_cloudkms",
        "@maven//:com_google_cloud_google_cloud_kms",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
        "@maven//:com_google_protobuf_protobuf_java",
    ],
)

java_plugin(
    name = "auto_service_plugin",
    processor_class = "com.google.auto.service.processor.AutoServiceProcessor",
    deps = [
        "@maven//:com_google_auto_auto_common",
        "@maven//:com_google_auto_service_auto_service",
    ],
)

java_library(
    name = "fake_cloud_kms",
    testonly = 1,
    srcs = ["FakeCloudKms.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink:aead",
        "//src/main/java/com/google/crypto/tink:key_templates",
        "//src/main/java/com/google/crypto/tink:registry_cluster",
        "@maven//:com_google_api_client_google_api_client",
        "@maven//:com_google_apis_google_api_services_cloudkms",
        "@maven//:com_google_http_client_google_http_client",
        "@maven//:com_google_http_client_google_http_client_gson",
    ],
)

java_library(
    name = "fake_key_management_service_client",
    srcs = ["FakeKeyManagementServiceClient.java"],
    deps = ["@maven//:com_google_cloud_google_cloud_kms"],
)
